package com.airnewslinkosky.ticket.adapter;

import java.util.List;
import java.util.Map;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import android.widget.CompoundButton.OnCheckedChangeListener;

import com.airnewslinkosky.ticket.R;

public class PassengerAdapter extends MySimpleAdapter  {
	LayoutInflater layoutInflater ;
	List<Map<String, Object>> items;
	Context context;

	public PassengerAdapter(Context context, List<Map<String, Object>> items, int resource, String[] from, int[] to) {   
		super(context, items, resource, from, to);   
		this.context = context;
		layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
	}  
	
	public PassengerAdapter(Context context, List<Map<String, Object>> items) { 
		super(context, items, 0, null, null);  
		this.context = context;
		this.items = items;
		this.layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
	}  
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		final View v = super.getView(position, convertView, parent);
		final CheckBox checkPassenger = (CheckBox) v.findViewById(R.id.checkPassenger);
		final Button delete_order_passenger = (Button) v.findViewById(R.id.delete_order_passenger);
		
		checkPassenger.setClickable(true);
		TextView numberView = (TextView) v.findViewById(R.id.passenger_id_number);
		final String number  = numberView.getText().toString();

		
		
		checkPassenger.setOnClickListener(new OnClickListener(){

			public void onClick(View v) {
				// TODO Auto-generated method stub
				
			}
			
		});
		return convertView;

	}
	
	static class ViewHolder { 
		TextView passengerName,passengerIdNumber; 
		CheckBox checkPassenger;
	} 


}
